﻿'   fTray client options class
'   Copyright (c) 2010 Marvin Westmaas ( MtM / Marvin_The_Martian )
'
'   This program is free software: you can redistribute it and/or modify
'   it under the terms of the GNU General Public License as published by
'   the Free Software Foundation, either version 3 of the License, or
'   (at your option) any later version.
'
'   This program is distributed in the hope that it will be useful,
'   but WITHOUT ANY WARRANTY; without even the implied warranty of
'   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
'   GNU General Public License for more details.
'
'   You should have received a copy of the GNU General Public License
'   along with this program.  If not, see <http://www.gnu.org/licenses/>.
Public Class frmOptions

    Private Sub cmdCancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdCancel.Click
        Me.Close()
    End Sub

    Private Sub frmOptions_Shown(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Shown
        Try
            With My.Settings
                chkStart.Checked = .bStartWin
                chkClientStart.Checked = .bStartClient
                cmbStart.Text = .StartMethod
                cmbStart.Enabled = chkStart.Checked
            End With
        Catch ex As Exception

        End Try
    End Sub

    Private Sub chkStart_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles chkStart.CheckedChanged
        Try
            cmbStart.Enabled = chkStart.Checked
        Catch ex As Exception

        End Try
    End Sub



    Private Sub cmdAccept_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdAccept.Click
        Try
            With My.Settings
                .bStartWin = chkStart.Checked
                .bStartClient = chkClientStart.Checked
                .StartMethod = cmbStart.Text
            End With
            My.Settings.Save()
            Me.Close()
        Catch ex As Exception

        End Try
    End Sub
End Class